package com.tcenter.dao.entities;


import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 */
@Entity
@Table(name = "user_verification", catalog = "tcenterdb")
public class UserVerification implements java.io.Serializable {

    private Integer id;
    private User user;
    private Date initiatedOn;
    private Date validTo;
    private String description;


    public UserVerification() {
    }

    public UserVerification(User user) {
        this.user = user;
    }

    public UserVerification(User user, Date initiatedOn, Date validTo,
                            String description) {
        this.user = user;
        this.initiatedOn = initiatedOn;
        this.validTo = validTo;
        this.description = description;
    }


    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id", nullable = false)
    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "initiated_on", length = 19)
    public Date getInitiatedOn() {
        return this.initiatedOn;
    }

    public void setInitiatedOn(Date initiatedOn) {
        this.initiatedOn = initiatedOn;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "valid_to", length = 19)
    public Date getValidTo() {
        return this.validTo;
    }

    public void setValidTo(Date validTo) {
        this.validTo = validTo;
    }

    @Column(name = "description", length = 128)
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

}
